package com.ebs.gparecorderweb.model;

public class Course {
	private String name;
	private double credit;
	
	public Course(String name, double credit){
		this.name = name;
		if(isValidCredit(credit)){
			this.credit = credit;
		}
		else{
			this.credit = -1;
		}
		
	}
	
	public boolean isValidCredit(double credit){
		if(credit >= 0 && credit <= 4){
			return true;
		}
		else{
			return false;
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getCredit() {
		return credit;
	}

	public void setCredit(double credit) {
		this.credit = credit;
	}
	
	
}
